<!DOCTYPE html>
<html>

	<head>
		<meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" href="../../css/iuapmobile.um.css">
		<link rel="stylesheet" href="../../css/font-icons.css">
		<link rel="stylesheet" type="text/css" href="../../css/iuapmobile.um.listview.css">

		<style>
			.listview-detail {
				overflow: hidden;
				text-overflow: ellipsis;
				display: -webkit-box;
				-webkit-line-clamp: 2;
				-webkit-box-orient: vertical;
			}
		</style>

		<script src="../../js/summer.js"></script>
		<script src="../../js/jquery.min.js"></script>
		<script src="../../js/Frameworks/iuapmobile.frameworks.ui.js"></script>
		<script type="text/javascript" src="../../js/knockout.js"></script>
		<script type="text/javascript" src="../../js/Frameworks/iuapmobile.frameworks.listview.js"></script>
	</head>

	<body>
		<div class="um-win" id="shangjiatuozhanlist">
			<div class="um-header">
				<h3>验收列表</h3>
				<a class="um-back back">返回</a>
			</div>

			<div class="um-content">
			    <div class="um-input-group" style="margin-top: 5px;margin-bottom: 5px">
                	<span class="ti-search"></span>
                	<input type="search" id="searchCode" class="form-control" placeholder="请输入过滤条件">
                	<button class="btn btn-inline" onclick="rebind()">&nbsp;&nbsp;搜&nbsp;索&nbsp;&nbsp;</button>
                </div>
                
				<div class="um-listview-wrap" id="listview">
					<div class="hd1 pt15 pb15 f15" style="text-align: center;">
						<span class="ti-reload"></span> 没有找到数据 点击刷新
					</div>
					<ul class="um-list um-no-active" data-bind="foreach: data" style="margin-bottom: 10px">
						<li class="um-listview-row">
							<a href="#" class="um-list-item um-swipe-action um-no-icon">
								<div class="um-list-item-inner">
									<div class="um-list-item-body um-text-overflow f14" style="padding-right:5px;">
										<div class="um-bgc-blue um-white pt5 pb5 ">
											︱点位编号:<span data-bind="text:pointId"></span>
										</div>
										<div class="w">
											<div class="um-md-6 w_50 fl mt10 mb10">
												状态:<span data-bind="text:zt"></span>
											</div>
											<div class="um-md-6 w_50 fl mt10 mb10">
												日期:<span data-bind="text:rq"></span>
											</div>
										</div>
										<div class="w">
											<div class="um-md-6 w_50 fl mt10 mb10">
												全景,近景，远景:
											</div>
											<div class="um-md-6 w_50 fl mt10 mb10">
												<img data-bind="attr:{src:baroundimage}" style="height: 30px" class="lookimg"/>
												&nbsp;
												<img data-bind="attr:{src:bcloseimage}" style="height: 30px" class="lookimg"/>
												&nbsp;
												<img data-bind="attr:{src:bfarimage}" style="height: 30px" class="lookimg"/>
												
											</div>
										</div>
									</div>
								</div>
							</a>
						</li>
					</ul>
					<p id="lookMore" style="text-align: center;margin-top: 10px;margin-bottom: 10px;" onclick="bind(pageIndexNow + 1);">查看更多</p>
				</div>

			</div>

			<div class="um-footer">

			</div>
		</div>

		<script>
			var pageIndexNow = 1; //当前第几页
			$(function() {
				var ViewModel = function() {};
				var viewModel = new ViewModel();
				//构造控件实例
				var listview = UM.listview("#listview");
				viewModel.data = ko.observableArray([]);
				ko.applyBindings(viewModel);
				//绑定叶号，是否第一次bool

				var bind = function(Pageindex) {
					var userinfo = summer.getStorage("userinfo");
					doPost(adressHead.ISjtzImpl, "getReport_dwxx", { //getAzPgxxList   getAcceptanceCheckList
						dataParm: {
							empId: userinfo.empId,
							star: Pageindex == 1 ? 1 : (((Pageindex - 1) * 5) + 1),
							count: 5,
							content:$("#searchCode").val(),
						}
					}, function(jsons) {
						var binddata = jsons.data;
						var zhuanhuanhou = [];
						for(var i=0;i<binddata.length;i++){
							var a = binddata[i];
							zhuanhuanhou.push({
								pointId:a.tsjjymc+ " " + a.bdwh,
								zt:a.spzt,
								rq:a.dbilldate,
								baroundimage:getImgUrl(binddata[i].baroundimage),
								bcloseimage:getImgUrl(binddata[i].bcloseimage),
								bfarimage:getImgUrl(binddata[i].bfarimage)
							});
						}
						binddata = zhuanhuanhou;
						console.log(binddata);
						
						if(Pageindex == 1) {
							try {
								while(viewModel.data.shift()) {}
								listview.refresh();
							} catch(e) {}
						}

						if(binddata.length == 0) {
							if(Pageindex == 1) {
								$(".hd1").css("display", "block"); //show
							}
							UM.toast({
								title: '友情提示：',
								text: '没有数据了'
							});
						} else {
							pageIndexNow = Pageindex;
							$(".hd1").css("display", "none"); //hide
						}

						for(var i = 0; i < binddata.length; i++) {
							viewModel.data.push(binddata[i]);
						}
						listview.refresh();
						init();
					});
				}
				window.bind = function(ind) {
					if(!ind){
						ind = 1;
					}
					bind(ind);
				};

				$(".hd1").click(function() {
					bind(1);
				});
				//添加控件方法
				listview.on("pullDown", function(sender) {
					bind(1);
					sender.refresh(); 
				});
				listview.on("pullUp", function(sender) {
					bind(pageIndexNow + 1);
					sender.refresh();
				});
				//listview.on("itemClick", function(sender, args) {
				//	console.log(JSON.stringify(viewModel.data()[args.rowIndex]));
				//});
			});

			function rebind() {
				window.bind();
			}

			summerready = function() {
				window.bind();
			}
		</script>
	</body>

</html>
<script src="../../js/Myjs/Common.js"></script>